<template>
	<view class="payment">
		<image class="sign_success" src="/static/index/sign-success.png" mode="widthFix"></image>
		<view class="pay_tip">兑换成功</view>
			<view class="pay_title">
				{{data.name}}
			</view>
			<view class="line"></view>
			<view class="pay_body">
				<view class="pay_item">
					<text class="pay_item_left">订单编号</text>
					<view class="pay_time_right" @click="copy(data.orderNo)" style="display: flex;flex-direction: row; align-items: center; ">
						<view class="ellipseHide" style="max-width:380rpx;">{{data.orderNo}}</view>
						<view class="copy">复制</view>
					</view>
				</view>
				<view class="pay_item">
					<text class="pay_item_left">交易时间</text>
					<view class="pay_time_right">
						<text>{{data.tradeTime}}</text>
					</view>
				</view>
			</view>
			<view class="repayments" @click="repaymentSu">立即查看</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:{
					id:'',
					name:'',
					orderNo:'',
					tradeTime:''
				},
			}
		},
		onLoad(e) {
			this.data = e
			// this.orderId = e.orderId
			console.log(this.orderId)
			// this.getPayResult()
		},
		methods: {
			async getPayResult(){
				uni.showLoading({ title:'加载中' })
				try{
					var res = await api.getPayResult(this.orderId)
					  this.data = res.result
						  uni.hideLoading()
				}catch{
					uni.hideLoading()
				}

			},
			copy(text){
				if(text != ''){
					var _this = this
					 _this.$copyText(text).then(
                        res => {
                          uni.showToast({
                            title: '复制成功',
                            icon: 'none'
                          })
                        }
                      )
				}
			},
			repaymentSu(){
				uni.redirectTo ({
					url:'/pages/my/shenye-market/exchange-record/redemption-details/redemption-details?id='+this.data.id
				})
				
			}
		}
	}
</script>

<style scoped>
	.payment{
		width: 100%;
		padding-top: 112rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.payment .sign_success{
		width: 152rpx;
		height: 152rpx;
	}
	.pay_tip{
		text-align: center;
		font-weight: 400;
		font-size: 36rpx;
		color: #000000;
		margin-top: 20rpx;
	}
	.pay_title{
		font-size: 30rpx;
		color: #222222;
		margin-top: 30rpx;
	}
	.line{
		width: 668rpx;
		margin: 40rpx 0;
		border-bottom: 1rpx solid #D8D8D8;
	}
	.pay_item{
		width: 100%;
		min-width: 620rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 36rpx;
		font-size: 28rpx;
		font-weight: 400;
	}
	.pay_item .pay_item_left{
		color: rgba(153, 153, 153, 0.8);
	}
	.pay_item .pay_time_right{
		color: #000000;
		max-width: 460rpx;
	}
	.pay_item .pay_time_right .copy{
		margin-left: 16rpx;
		color: #1774FF;
		text-align: right;
	}
	.repayments{
		width: 318rpx;
		height: 80rpx;
		border: 2rpx solid #6752EA;
		border-radius: 200rpx;
		text-align: center;
		line-height: 80rpx;
		margin-top: 80rpx;
		color: #6752EA;
		font-size: 34rpx;
	}
</style>
